package dataBase;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;

import dataBase.ISqlTable;
import dataBase.SqlTable;

public class UserDBMngr {
	private static UserDBMngr instance = new UserDBMngr();

	Statement stmt = null;

	ISqlTable userPasswordTable = null;
	ISqlTable userInfoTable = null;
	
	User currentUser = null;
		
	private UserDBMngr(){
		// singleton pattern
		userPasswordTable = DBInitializer.getInstance().getUserPasswordTable();
		userInfoTable = DBInitializer.getInstance().getUserInfoTable();
	}
	
	public static UserDBMngr getInstance(){
		return instance ;
	}
	
	public boolean addNewUser(User toAdd){
		return false;
	}

	public boolean validatePassword(String username, String password) throws SQLException {
		return ((UserPasswordSqlTable) userPasswordTable).validatePassword(username, password);
	}
}
